package com.example.projeto_edilson;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class GerenciarCasamento extends Activity {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.casamento);
		
		Button button = (Button) findViewById(R.id.buttonSalvar);
		final EditText noivoEditText = (EditText) findViewById(R.id.editTextNomeNoivo);
		final EditText noivaEditText  = (EditText) findViewById(R.id.editTextNomeNoiva);
		final EditText dataEditText  = (EditText) findViewById(R.id.editTextData);
		final EditText enderecoEditText  = (EditText) findViewById(R.id.editTextLocal);
		
		
		button.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				
				String noivo = noivoEditText.getEditableText().toString();
				String noiva = noivaEditText.getEditableText().toString();
				String data = dataEditText.getEditableText().toString();
				String endereco = enderecoEditText.getEditableText().toString();
				

				Intent intent = new Intent(GerenciarCasamento.this,MainActivity.class);
				intent.putExtra("noivo", noivo);
				intent.putExtra("noiva", noiva);
				intent.putExtra("data", data);
				intent.putExtra("endereco", endereco);
				startActivity(intent);
				
				
			}
		});
	}
}
